package study;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class IO_Example02 {

	public static void main(String[] args) {
		FileInputStream fis= null;
		FileOutputStream fos=null;

		int data=0;
		try
		{

			fis=new FileInputStream("c:/source.txt");
			fos=new FileOutputStream("c:/des.txt");;
			while( ((data= fis.read()) != -1) )
			{
				System.out.println(data);
				fos.write(data);
			}
		}
		catch(IOException ioe)
		{
			ioe.printStackTrace();
		}
		finally
		{
			try
			{
				if(fis!= null)
					fis.close();
				if(fos!=null)
					fis.close();
			}
			catch(IOException ioe)
			{
				ioe.printStackTrace();
			}		
		}

	}

}
